﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PNProject.EF;
using PNProject.Core;

namespace PNProject.Core.Converter
{
    public class OneContentConverter
    {
        public static OneContent ToOneContent(OneContentModel con)
        {
            OneContent obj = new OneContent();
            try
            {
                obj.OneContentID = con.OneContentID;
                obj.Name = con.Name;
                obj.TLink = con.TLink;
                obj.XContent = con.XContent;
                return obj;
            }
            catch (Exception e)
            {
                return new OneContent();
            }
        }

        public static OneContent CopyOneContent(OneContent con)
        {
            OneContent obj = new OneContent();
            try
            {
                obj.OneContentID = con.OneContentID;
                obj.Name = con.Name;
                obj.TLink = con.TLink;
                obj.XContent = con.XContent;
                return obj;
            }
            catch (Exception e)
            {
                return new OneContent();
            }
        }

        public static OneContentModel OneContentTo(OneContent con)
        {
            OneContentModel obj = new OneContentModel();
            obj.OneContentID = con.OneContentID;
            obj.Name = con.Name;
            obj.TLink = con.TLink;
            obj.XContent = con.XContent;
            return obj;
        }
    }
}